public class MyTest {
    public static void main(String[] args) {
        int j = 1;
        int sum = 0;
        while(j<=5){
            int i = 1;
            int ret = 1;
            while (i<=j){
                ret *=i;
                i++;
            }
            j++;
            sum +=ret;

        }
        System.out.println(sum);
    }
}
